'use client'; import { useState } from 'react'; import type { Chat } from '@/types/chat'; import { Flex, Layout, Row, Col, Input, Space, Upload, Button, Result } from 'antd'; import PageTitle from '@/components/ui/PageTitle'; import Navigation from '@/components/layout/Navigation' import { useParams } from 'next/navigation' import { useQuery } from '@tanstack/react-query'; import { getChat } from '@/app/api/user/chatService'; import { PaperClipOutlined, SendOutlined } from '@ant-design/icons' import LoadingScreen from '@/components/layout/LoadingScreen'; import ErrorPage from '@/components/layout/ErrorPage'; const ChatPage: React.FC = () => { const params = useParams() const chatID = Number(params.chatID); const { data: chat, error, isLoading } = useQuery({ queryKey: ["getChat"], queryFn: () => getChat(chatID) }) const [enabled, setEnabled] = useState(false); if (isLoading) return if (error) return return ( {chat?.name}
Profile

{ }

{chat?.persona?.role}

Live Offline
{/* Chat messages */}
{chat?.chatList.map((msg, index) => (

{msg.self ? 'Visitor' : 'Ruccan Chat'}

{msg.text}
{msg.time}
))}
); }; export default ChatPage;